package com.foster.eric.sample.weightloss.utils;

import com.foster.eric.sample.weightloss.form.Gender;
import com.foster.eric.sample.weightloss.form.Height;

public class ConverterUtils {
	
	public final static double MALE_ADJUSTMENT = 88.362;
	public final static double FEMALE_ADJUSTMENT = 447.593;
	
	
	public static double convertPoundsToKg(double pounds) {
		return pounds / 2.20462;
	}
	
	public static double convertInchesToCM( Height height )
	{
		int feetInInches = height.getFeet() * 12;
		int totalInches = feetInInches + height.getInches();
				
		return totalInches * 2.54;
	}
	
	public enum Multiplier
	{
		weight(13.397,9.247), height(4.799,3.098), age(5.677,4.330);
		
		private double maleMultiplier;
		private double femaleMultiplier;
		
		private Multiplier(double maleMultiplier,double femaleMultiplier)
		{
			this.maleMultiplier = maleMultiplier;
			this.femaleMultiplier = femaleMultiplier;
		}
		
		public double getMultiplier(Gender gender)
		{
			if(gender == Gender.male) return maleMultiplier;
			else return femaleMultiplier;
		}
	}
}
